% 根据决策树桩的阈值来分类(1,-1)
function predi_labels = decision(data, i_col, thresh_val, thresh_ineq)
% data:num_row*num_col,i_col:表示第i列,thresh_val:表示决策树桩的阈值,thresh_ineq:采用大于或者小于来比较阈值
% predi_labels:根据决策树桩的阈值来获得分类后的labels,num_row*1
num_row = size(data, 1);
% 初始化predi_labels为全1
predi_labels = ones(num_row, 1);
if thresh_ineq == 1
    % 1表示小于阈值,如果小于阈值,则判定为-1
    predi_labels(data(:, i_col) <= thresh_val) = -1;
elseif thresh_ineq == 2
    % 如果大于阈值,则判定为-1
    predi_labels(data(:, i_col) > thresh_val) = -1;
end
end